home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / 3dprograms / rayshade-4.0 / fixes / fix019 < prev    next >
Internet Message Format  |  1995-02-13  |  4KB

  1. From theseas!Princeton.EDU!cek Mon, 18 Jul 94 15:48:55 EET
  2. Received: by kriton.UUCP (V1.17-beta/Amiga)
  3.       id <03rm@kriton.UUCP>; Mon, 18 Jul 94 15:48:55 EET
  4. Received: by theseas.ntua.gr with UUCP; Mon, 18 Jul 1994 11:32:18 +0300
  5. Received: from nemesis.ics.forth.gr (nemesis.csi.forth.gr) by pythia.ics.forth.gr via FORTHnet with SMTP;
  6.     id AA12257 (5.65c/FORTH-ICS-3.0-MHS-7.0); Mon, 18 Jul 1994 10:47:55 +0300
  7. Received: from eunet.EU.net by nemesis.ics.forth.gr via FORTHnet with SMTP;
  8.     id AA22833 (5.65c/ICS-1.1); Mon, 18 Jul 1994 10:39:39 +0300 (EET DST)
  9. Received: (uunet@localhost) by eunet.EU.net (8.6.8/8.6.4) with UUCP id JAA16753 for ariadne!theseas!kriton!kyrimis; Mon, 18 Jul 1994 09:35:27 +0200
  10. Received: from Princeton.EDU by relay1.UU.NET with SMTP 
  11.     (relay) id QQwzba02762; Mon, 18 Jul 1994 03:32:30 -0400
  12. Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.111/princeton)
  13.     id AA17932; Mon, 18 Jul 94 03:29:13 -0400
  14. Received: by cs.Princeton.EDU (4.1/1.105)
  15.     id AA00261; Mon, 18 Jul 94 03:29:12 EDT
  16. Received: from iraun1.ira.uka.de by cs.Princeton.EDU (4.1/1.105)
  17.     id AA00175; Mon, 18 Jul 94 03:28:50 EDT
  18. Received: from i44ms.ira.uka.de by iraun1.ira.uka.de with SMTP (PP);
  19.           Mon, 18 Jul 1994 09:28:08 +0200
  20. Received: from i44s15.ira.uka.de (i44s15.ira.uka.de [129.13.14.26]) 
  21.           by i44ms.ira.uka.de (8.6.4/8.6.4) with ESMTP id NAA00609;
  22.           Fri, 15 Jul 1994 13:55:04 +0200
  23. Received: from localhost (tmueller@localhost) 
  24.           by i44s15.ira.uka.de (8.6.4/8.6.4) id NAA25503;
  25.           Fri, 15 Jul 1994 13:55:01 +0200
  26. Organization: Institute of Computer Science, 
  27.     Foundation for Research and Technology-Hellas (FORTH)
  28.     P.O.Box 1385,
  29.     GR 711 10 Heraklion, Crete, Greece        
  30.     tel.: +30 (81) 39 16 00,  fax: +30 (81) 39 16 01
  31. Date: Fri, 15 Jul 1994 13:55:01 +0200
  32. Message-Id: <199407151155.NAA25503@i44s15.ira.uka.de>
  33. X-Organization: IPD Universitaet Karlsruhe Vincenz-Priessnitz-Strasse 1 D-76131 
  34.                 Karlsruhe
  35. X-Phone: +49-721-608-6087
  36. X-Fax: +49-721-691462
  37. Reply-To: tmueller@ira.uka.de
  38. Errors-To: rayshade-users-request@cs.Princeton.EDU
  39. Remailed-Date: Mon Jul 18 03:28:54 EDT 1994
  40. From: Thomas Mueller AKA Howie <tmueller@ira.uka.de>
  41. To: rayshade-users@cs.Princeton.EDU
  42. Subject: csg with more then 2 objects
  43.  
  44. Hi!
  45.  
  46. Finally I was so tired of writing those deeply nested csg specifications that
  47. I have fixed the problem.  If you want this too, simply replace the function
  48. CsgConvert in libray/libobj/csg.c with the code at the end of this mail.
  49.  
  50. The new version of CsgConvert transforms a construct like
  51.  
  52. union obj1 obj2 obj3 end
  53.  
  54. into
  55.  
  56. union union obj1 obj2 end obj3 end
  57.  
  58. in terms of internal data structures.
  59.  
  60. Thomas
  61.  
  62. ----8<--------8<--------8<--------8<--------8<--------8<--------8<----
  63. int
  64. CsgConvert(csg, list)
  65. Csg *csg;
  66. Geom *list;
  67. {
  68.     static int OpenAdvised = FALSE;
  69.     int prims = 0;
  70.  
  71.     if (!list || !list->next) {
  72.         RLerror(RL_WARN, "CSG needs at least two objects.\n");
  73.         return 0;
  74.     }
  75.     /*
  76.      * Things are put into lists backwards....
  77.      */
  78.     csg->obj2 = list;
  79.     if (!list->methods->closed && !OpenAdvised) {
  80.       RLerror(RL_ADVISE, "Performing CSG with non-closed object(s).\n");
  81.       OpenAdvised = TRUE;
  82.     }
  83.     prims += list->prims;
  84.     list = list->next;
  85.     while (list->next) {
  86.       csg->obj1 = GeomCsgCreate(csg->operator);
  87.       csg = (Csg*)csg->obj1->obj;
  88.       csg->obj2 = list;
  89.       if (!list->methods->closed && !OpenAdvised) {
  90.         RLerror(RL_ADVISE, "Performing CSG with non-closed object(s).\n");
  91.         OpenAdvised = TRUE;
  92.       }
  93.       prims += list->prims;
  94.       list = list->next;
  95.     }
  96.     csg->obj1 = list;
  97.     if (!list->methods->closed && !OpenAdvised) {
  98.       RLerror(RL_ADVISE, "Performing CSG with non-closed object(s).\n");
  99.       OpenAdvised = TRUE;
  100.     }
  101.     prims += list->prims;
  102.  
  103.     return prims;
  104. }
  105.  
  106. ----------
  107. Administrivia: rayshade-users-request@cs.princeton.edu
  108. Mailing list: rayshade-users@cs.princeton.edu
  109.  
  110.